{extend name="base/index"/}

{block name="page_location"}
<div class="row">
	<div class="col-12">
		<div class="page-title-box">
			<div class="page-title-right">
				<ol class="breadcrumb m-0">
					<li class="breadcrumb-item"><a href="{:url('index/index')}">管理中心</a></li>
					<li class="breadcrumb-item active"><i class="iconfont icon-angle-right"></i>物流公司管理</li>
				</ol>
			</div>
			<h4 class="page-title">
				所有物流公司
			</h4>
		</div>
	</div>
</div>
{/block}

{block name="body"}
<div class="row" id="express_page">
	<div class="col-12">
		<div class="card">
			<div class="card-body">
				<p>
				<a href="javascript:;" class="btn btn-success btn-sm" data-toggle="modal" data-target="#new_box" id="add_express_btn">创建新的物流公司</a>				
				</p>				
				<table class="table table-hover">
                    <thead>
                        <tr>
                            <th>ID</th>
                            <th>物流公司LOGO</th>
                            <th>物流公司名称</th>
                            <th>物流公司编码</th>
                            <th>是否常用</th>
                            <th>更新时间</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        {volist name='list' id="data"}
                        <tr>
                            <td>{$data.id}</td>
                            <td><a href="javascript:;" target="_blank"><img class="list_facepic preview_img" style="width: auto;height: auto;" src="{$data.logo|default='/static/admin/images/nopic.png'}" /></a></td>
                            <td>{$data.name}</td>
                            <td>{$data.no}</td>
                            <td>
                            	{eq name="data.common" value="0"}
                            	<a href="javascript:;" attr-model="express" attr-id="{$data.id}" attr-field="common" attr-val="1" class="btn red mini Fast_Action">常用</a>
                            	{else /}
                            	<a href="javascript:;" attr-model="express" attr-id="{$data.id}" attr-field="common" attr-val="0" class="btn mini Fast_Action">不常用</a>
                            	{/eq}                          	
                            </td>
                            <td title="{$data.posttime|date="Y-m-d H:i:s",###}">{$data.posttime|date="m-d H:i",###}</td>
                            <td>
							    <a href="javascript:;" class="btn btn-primary btn-sm edit_btn" attr-id="{$data.id}" data-toggle="modal" data-target="#new_box">修改信息</a>
								<a href="javascript:;" class="btn btn-primary btn-sm Fast_Del" attr-id="{$data.id}" attr-model="express">删除</a>
                            </td>
                        </tr>
                        {/volist}
                    </tbody>
                </table>
				<div class="row">
					<div class="col-12" style="text-align: center;">
						{$pagelist}
					</div>
				</div>				
			</div>
		</div>
	</div>
</div>

<!-- END PAGE CONTENT-->
{/block}
{block name="modal_dig"}
<!-- Modal -->
<div class="modal fade" id="new_box" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <h4 class="modal-title dig_title" id="myModalLabel"></h4>
          <button type="button" class="close" data-dismiss="modal">x</button>
        </div>
        <div class="modal-body">
            <form action="#" class="form-horizontal" id="edit_express_frm">
            	<input type="hidden" name="id" value="" />
                <div class="form-group row mb-1">
                    <label class="col-5 col-form-label">物流公司名称：</label>
                    <div class="col-7">
                        <input type="text" name="name" placeholder="请输入物流公司名称" class="form-control ipt_check" data-type="name" data-len="2-20" nullmsg="物流公司名称不能为空" errormsg="物流公司名称只能由2到20位的字母、汉字组成">
                        <span class="help-inline"><span class="label label-important"> 必填</span></span>
                    </div>
                </div>
                <div class="form-group row mb-1">
                    <label class="col-5 col-form-label">物流公司编码：</label>
                    <div class="col-7">
                        <input type="text" name="no" placeholder="请输入物流公司编码" class="form-control ipt_check" data-type="name" data-len="2-20" nullmsg="物流公司编不能为空" errormsg="物流公司编只能由2到20位的字母组成">
                        <span class="help-inline"><span class="label label-important"> 必填</span></span>
                    </div>
                </div>                
                <div class="form-group row mb-1">
                    <label class="col-5 col-form-label">物流公司LOGO：</label>
                    <div class="col-7 logo_box">
                        <div class="picurl" data-type="upload" attr-inputname="logo" attr-value=""  isCompress="1"></div>
                    </div>
                </div>
                <div class="form-group row mb-1">
                    <label class="col-5 col-form-label">是否常用：</label>
                    <div class="col-7">
                        <div class="custom-control custom-radio">
                            <input type="radio" name="common" id="common1" class="custom-control-input" value="0" checked="checked">
                            <label class="custom-control-label" for="isshow1">是</label>
                        </div>
                        <div class="custom-control custom-radio">
                            <input type="radio" name="common" id="common2" class="custom-control-input" value="1">
                            <label class="custom-control-label" for="isshow2">否</label>
                        </div>
                    </div>
                </div>
            </form>
        </div>
        <div class="modal-footer">
            <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
            <button type="button" class="btn btn-primary Fast_Form_Post" attr-frm="#edit_express_frm" attr-model="express" attr-active="save_express" attr-callback="reload">保存</button>
        </div>
      </div>
    </div>
  </div>
{/block}